Skip to content

chore: protect main and the release tags - #3

Merged
lintdeveloper merged 1 commit into
mainfrom
chore/document-branch-protection
Aug 16, 2026
Merged

chore: protect main and the release tags#3
lintdeveloper merged 1 commit into
mainfrom
chore/document-branch-protection

Conversation

@lintdeveloper

Copy link
Copy Markdown
Owner

Documents the three rulesets now guarding main and v* tags, and why they are split rather than bundled.

Also the first change to go through the new PR flow, which is itself the test that the rules do not block ordinary work.

main had no protection at all — a force-push or an accidental delete would
have destroyed history on a repo that is now public and published.

Three rulesets, split deliberately rather than bundled into one:

  main: no force-push, no deletion    no bypass, not even the owner
  main: PR + green checks             bypass: repository admin
  release tags are immutable          no bypass, v* cannot move or be deleted

The split is the point. Rewriting main is the only mistake here that destroys
work rather than just making a mess, so it has no escape hatch. The PR rule
does, because a solo maintainer cannot approve their own pull request and a
hard gate would mean self-blocking or fake reviews — remove the bypass actor
when there is a second maintainer.

Tags are immutable because a published npm version is. v0.5.0 must keep
pointing at the commit whose provenance attestation says it built resilix@0.5.0.

Two checks are deliberately NOT required: Deploy to Pages and release are
push-triggered only, so they never report on a pull request, and requiring a
check that cannot run blocks every merge forever.

Every rule was tested rather than assumed, which caught a bad test of my own:
`git push --force` of a descendant commit is a fast-forward, not a force, so
it proved nothing and pushed an empty commit to main. The real test is a
rewind — `push --force origin/main~1:main` — which is correctly rejected.
Deletion of main and of v0.5.0 are both rejected too.

Also closes the stale Version Packages PR. It was built from the four
changesets consumed manually during the 0.5.0 release, so it had gone
conflicting and would have rolled package.json back to 0.2.0.
@lintdeveloper
lintdeveloper merged commit a4356a4 into main Aug 16, 2026
11 checks passed
@lintdeveloper
lintdeveloper deleted the chore/document-branch-protection branch August 16, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant